import { defineStore } from 'pinia'
interface State {
  showLayer: boolean;
  preImages: string[];
  preImageIndex: number;
  showVideoLayer: boolean;
  preVideos: string;
  token:string;
}

export const useAppStore = defineStore({
  id: 'app',
  state: (): State =>({
    showLayer: false,
    preImages: [],
    preImageIndex: 1,
    showVideoLayer: false,
    preVideos: '',
    token: ''
  }),
  getters: {
    
  },
  actions: {
    setPreImages(preImages:string[]){
      this.preImages = preImages
    },
    setPreImageIndex(preImageIndex:number){
      this.preImageIndex = preImageIndex
    },
    setShowLayer(showLayer:boolean){
      console.log('setShowLayer')
      this.showLayer = showLayer
    },
    setShowVideoLayer(showVideoLayer:boolean){
      this.showVideoLayer = showVideoLayer
    },
    setPreVideos(preVideos:string){
      this.preVideos = preVideos
    },
    setToken(token:string){
      this.token = token
    }
  },
})
export default useAppStore
